﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>好友列表 - {site.Name}</title>
<script type="text/javascript" src="{site.Dir}_data/SysConfig.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery-min.js"></script>
<script type="text/javascript" src="{site.Dir}_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="{site.Dir}scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="{site.Dir}style/global.css" />
<script type="text/javascript" src="{site.Dir}scripts/front.js"></script>
<style type="text/css">
@import url({site.Dir}user/otherfiles/css/style.css);
</style>
<script type="text/javascript">
var pagesize=20;
var page=thispage();
(function(){
	$(document).ready(function() {
		$.ajax({
			type:		"get",
			dataType:	"json",
			data:		"time="+(new Date().getTime()),
			url:		site.Dir + "ajax/user.aspx?oper=ajaxUserInfo",
			error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
			success:	function(data){
				//数据绑定
				$(".index_name").html(data.username+"（"+data.groupname+"）");
				$("#u_myface").attr("src","{site.Dir}avatar/"+data.userid+"_l.jpg?" + (new Date().getTime()));
				$(".u_email").text(data.email);
				if(data.sex=="2")
					$(".u_sex").text("女");
				if(data.sex=="0")
					$(".u_sex").text("保密");
				ajaxList(page);
			}
		});
	});
})();
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=ajaxGetList",
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: false});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function ConfirmDel(id){
	JumbotCms.Confirm("确定要删除该好友吗？", "ajaxDel("+id+")");
}
function ajaxDel(id){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.LoginUrl + "';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
</script>
<script type="text/javascript" src="{site.Dir}user/otherfiles/scripts/ajax.js"></script>
</head>
<body>
<iframe frameborder="0" scrolling="no" src="{site.Dir}user/index/index.aspx?do=header" width="100%" height="76" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="ifheader"></iframe>
<!--顶部结束,中框架开始-->
<div id="wrap">
	<div id="main">
		<div id="app_sidebar">
			<ul class="app_list" id="default_userapp">
				<li class="currently"><img src="{site.Dir}user/otherfiles/image/writer_v2/user_home.gif"><a href="{site.Dir}user/index/index.aspx">用户管理中心</a></li>
			</ul>
			<ul class="app_list" id="my_userapp">
				<li class="hr"></li>
				<li><img src="{site.Dir}user/otherfiles/image/writer_v2/contribute.gif"><a href="{site.Dir}user/contribute/index.aspx" target="_blank">我的投稿</a><em></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/message.gif"><a href="{site.Dir}user/pmlist/index.aspx">短信</a><em><a href="{site.Dir}user/pmsend/index.aspx">发送</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/friend.gif"><a href="{site.Dir}user/friendlist/index.aspx">好友</a><em><a href="{site.Dir}user/friendadd/index.aspx">添加</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/mtag.gif"><a href="{site.Dir}mtag/index/index.aspx">群组</a><em><a href="{site.Dir}user/mtag_thread">话题</a></em></li>
				<li><img src="{site.Dir}user/otherfiles/image/app/favorite.gif"><a href="{site.Dir}user/favorite/index.aspx">收藏夹</a>
			</ul>
		</div>
		<div id="mainarea">
			<div id="content">
				<div class="composer_header">
					<div style="float:left;width:137px;">
						<div class="ar_r_t">
							<div class="ar_l_t">
								<div class="ar_r_b">
									<div class="ar_l_b"><img id="u_myface" src="{site.Dir}avatar/0_l.jpg" onerror="this.src='{site.Dir}avatar/0_l.jpg'" width="120" height="120" /></div>
								</div>
							</div>
						</div>
					</div>
					<div class="composer" style="float:left">
						<h3 class="index_name">username</h3>
						<p>绑定邮箱：<span class="u_email"></span></p>
					</div>
				</div>
			</div>
			<br />
			<div class="clear"></div>
			<div class="tabs_header">
				<ul class="tabs">
					<li class="active"><a><span>好友列表</span></a></li>
					<li><a href="{site.Dir}user/friendadd/index.aspx"><span>添加好友</span></a></li>
					<li><a><span>邀请好友</span></a></li>
				</ul>
			</div>
			<div class="c_form">
            <textarea id="tplList" style="display:none"><ul class="avatar_list">
	{#foreach $T.table as record}
	<li>
		<div class="avatar48"><a href="javascript:void(0);" onclick="ShowUserPage({$T.record.frienduserid});" title="{$T.record.friendusername}"><img src="{site.Dir}avatar/{$T.record.frienduserid}_m.jpg" onerror="this.src='{site.Dir}avatar/0_m.jpg'" alt="{$T.record.friendusername}" width="48" height="48" /></a></div>
		<p><a href="javascript:void(0);" onclick="ShowUserPage({$T.record.frienduserid});" title="{$T.record.friendusername}">{$T.record.friendusername}</a></p>
		<p><a href="javascript:void(0);" title="将{$T.record.friendusername}从你的好友列表中删除" id="a_online_friend_{$T.record.frienduserid}" onclick="ConfirmDel({$T.record.id})">解除好友</a></p>
	</li>
	{#/for}
</ul></textarea>
				<div id="ajaxList"></div>
				<div class="clear"></div>
				<div id="ajaxPageBar" class="pages"> </div>
			</div>
			<div style="display:none;">
				<form method="get" action="{site.Dir}user/network" class="c_form">
					<table cellspacing="0" cellpadding="0" class="formtable">
						<caption>
						<h2>高级搜索</h2>
						<p>您可以自己设置搜索条件，寻找与自己志同道合的好友</p>
						</caption>
						<tr>
							<th>用户名</th>
							<td><input type="text" class="t_input" name="username" value="" />
								&nbsp; 姓名
								<input type="text" class="t_input" name="name" value="" />
							</td>
						</tr>
						<tr>
							<th>性别</th>
							<td><select id="sex" name="sex">
									<option value="0">任意</option>
									<option value="1">男</option>
									<option value="2">女</option>
								</select>
							</td>
						</tr>
						<tr>
							<th>QQ</th>
							<td><input type="text" name="qq" value="" class="t_input" />
								&nbsp; MSN
								<input type="text" name="msn" value="" class="t_input" />
							</td>
						</tr>
					</table>
					<table cellspacing="0" cellpadding="0" class="formtable">
						<tr>
							<th>&nbsp;</th>
							<td><input type="hidden" name="ac" value="space" />
								<input type="hidden" name="searchmode" value="1" />
								<input type="submit" name="findsubmit" value="寻找好友" class="submit" />
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<div id="bottom"></div>
	</div>
	<div id="footer" title=""> </div>
</div>
<iframe frameborder="0" scrolling="no" src="{site.Dir}user/index/index.aspx?do=footer" width="100%" height="50" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="iffooter"></iframe>
</body>
</html>
